/*
 * Vehicle.h
 *
 *  Created on: 14 mei 2013
 *      Author: Wietse
 */

#ifndef VEHICLE_H_
#define VEHICLE_H_

#include "Definitions.h"
#include "Data.h"
#include "Message.h"
#include "Position.h"

#include <vector>
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>

class Vehicle
{
private:
	// Help functions
	void 				outputTime(std::ofstream&);
	std::string			getFilename();
	std::string			getIdentifier();
	std::string			intToString(int);

protected:
	// Main vehicle attributes
	Component			sourceType;
	int					ID;
	Position			position;
	std::vector<Data>	receivedData;

	// Image arrays
	bool				imageQuadcopters[NUM_OF_QUADCOPTERS];
	bool				imageCrawlers[NUM_OF_CRAWLERS];

	void				removeData();	//Removes expired data

public:
	virtual 			~Vehicle();
	virtual void 		display() = 0;
	void				init();

	// Getters
	Component			getSourceType();
	int 				getID();
	Position* 			getPosition();

	// Message functions
	void 				receiveMessages(Swarm *);
	void				addData(Swarm*, Data&, bool);

	// Functions for print to the console
	void 				printData();
	void				printImage();
	void				printSourceType();
	void				printTime();

	// Functions for printing to output file
	void				clearFile();
	void				outputData();
	void				outputImage();
	void				outputImageCounter();
};

#endif /* VEHICLE_H_ */
